<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>WPF</title>
    <link  href="${ctx}/static/css/index.css" rel="stylesheet" type="text/css" /> 
    <link  href="${ctx}/static/ligerui/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" /> 
   
    <script src="${ctx}/static/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>    
    <script src="${ctx}/static/ligerui/lib/ligerUI/js/ligerui.min.js" type="text/javascript"></script> 
    
    <link href="${ctx}/static/ligerui/lib/css/common.css" rel="stylesheet" type="text/css" />  
    <link href="${ctx}/static/ligerui/lib/css/index.css" rel="stylesheet" type="text/css" />
    
    <link href="${ctx}/static/css/monitor/css/main.css" rel="stylesheet" type="text/css" />
    
    <script src="${ctx}/static/ligerui/lib/js/LG.js" type="text/javascript"></script>
    <script src="${ctx}/static/ligerui/lib/js/login.js" type="text/javascript"></script>
    <script src="${ctx}/static/js/main.js" type="text/javascript"></script>
    <script src="${ctx}/static/js/common.js" type="text/javascript"></script>
      
</head>
<body style="text-align:center; background:url('${ctx}/static/ligerui/lib/images/qso/bg-1477x768.jpg'); overflow:hidden;">
    <div id="pageloading" style="display:block;"></div> 
    <div id="topmenu" class="l-topmenu" style="height:40px;">
        <div class="l-topmenu-logo" style="padding-left: 0px; padding-top:0px;"><img src="${ctx}/static/css/monitor/img/monitorLogo.png" /></div>      
    </div> 
     <div id="mainbody" class="l-mainbody" style="width:100%; margin:0 -3px; margin-top:3px;" >
        <div position="center" id="framecenter"> 
             <div tabid="win4" title="<img src='${ctx}/static/css/monitor/img/win4Icon.png'> 四分屏"> 
                <iframe style="width:99%;" frameborder="0" name="win4" id="win4" src="${ctx }/qso/monitor/monitorWin4"></iframe>
            </div> 
             <div tabid="win9" title="<img src='${ctx}/static/css/monitor/img/win9Icon.png'> 九分屏"> 
                <iframe style="width:99%;" frameborder="0" name="win9" id="win9" src="${ctx }/qso/monitor/monitorWin9"></iframe>
            </div>
            <div tabid="students" title="<img src='${ctx}/static/css/monitor/img/studentIcon.png'> 指定学生"> 
                <iframe style="width:99%;" frameborder="0" name="students" id="students" src="${ctx }/qso/monitor/toSelect"></iframe>
            </div>    
        </div> 
    </div>
    <div class="l-hidden"></div>
    <script type="text/javascript">
		var isInitWinFour=true;
		var isInitWinNine=true;
    	var tabManager;
        //窗口改变时的处理函数
        function f_heightChanged(options) {
            if (tab)
                tab.addHeight(options.diff);
            if (accordion && options.middleHeight - 24 > 0)
                accordion.setHeight(options.middleHeight - 24);
        }
  
        $(document).ready(function ()
        {
            //布局初始化 
            //layout
            layout = $("#mainbody").ligerLayout({ height: '100%', heightDiff: -3, leftWidth: 0, onHeightChanged: f_heightChanged, minLeftWidth: 120 });
            var bodyHeight = $(".l-layout-center:first").height();
            //Tab
            tab = $("#framecenter").ligerTab({ height: bodyHeight,onAfterSelectTabItem:selectTab});
            tabManager = $("#framecenter").ligerGetTabManager();

            //预加载dialog的背景图片
            LG.prevDialogImage();
            
            $("#pageloading").hide();
            
        });

        
        function selectTab(tabid){
        	if(tabid=="win4" && isInitWinFour){
        		window.frames["win4"].init();
        	}else if(tabid=="win9" && isInitWinNine){
        		window.frames["win9"].init();
        	}
        }
        function selectStuBack(selectedSize){
        	if(selectedSize>0){
        		if(selectedSize>4){
        			tabManager.selectTabItem("win9");
        			window.frames["win9"].init();
        		}else{
        			tabManager.selectTabItem("win4");
        			window.frames["win4"].init();
        		}
        	}else{
        		$.ligerDialog.warn("未选择学生!");
        	}
        }
        
        function addTab(value,title){
        	var geo=getWinGeometry(window);
        	tabManager.addTabItem({ url:'${ctx}/qso/monitor/singleVm/'+value,text:title,tabid:value,height:geo.height+30,width:geo.width-200});
        }
    </script>
</body>
</html>